<template>
  <div class="menuTree">
    <label v-for="(menu,index) in data" :key="index">
      <el-submenu :index="index+''" v-if="menu.children">
        <template slot="title">
          <i style="color: #409eff;margin-right: 10px" :class="menu.iconCls"></i>
          <span>{{ menu.name }}</span>
        </template>
        <label>
          <menuTree :data="menu.children"></menuTree>
        </label>
      </el-submenu>
      <el-menu-item v-else :index="menu.path">
        <span slot="title">{{ menu.name }}</span>
      </el-menu-item>
    </label>
  </div>
</template>

<script>
import menuTree from "@/components/menuTree.vue";

export default {
  name: "menuTree",
  components: {
    menuTree: menuTree
  },
  props: ["data"],
};
</script>
<style scoped>
</style>